define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {


    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'information/kislog/index' + location.search,
                    del_url: 'information/kislog/del',
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                singleSelect:false,
                fixedColumns: true,
                fixedRightNumber: 1,
                showExport: false,
                showToggle:false,
                //showFullscreen:true,
                //striped:true,
                //remember: true,
                columns: [
                    [
                        {checkbox: true},
                        //{field: 'id', title:__('Id'), operate: false},
                        {field: 'title', title: __('Title'), operate: 'LIKE',width:150,align:'left'},
                        {field: 'log', title: __('Log'), operate: 'LIKE',width:400,align:'left'},
                        {field: 'createtime', title: __('createtime'),width:180, autocomplete:false},
                    ]
                ]
            });
         // 为表格绑定事件
            Table.api.bindevent(table);
            
            $(table).data("operate-del", null);
        },

        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            //获取选中的行
            selectedids: function (table, current) {
                var options = table.bootstrapTable('getOptions');
                //如果有设置翻页记忆模式
                if (!current && options.maintainSelected) {
                    return options.selectedIds;
                }
                return $.map(table.bootstrapTable('getSelections'), function (row) {
                    return row[options.pk];
                });
            },

            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});
